//
//  ZSCollectionViewlayout.m
//  fangwangyi
//
//  Created by 臧松 on 16/4/26.
//  Copyright © 2016年 zangsong. All rights reserved.
//

#import "ZSCollectionViewlayout.h"
#define kWIDTH [UIScreen mainScreen].bounds.size.width
#define kHEIGHT [UIScreen mainScreen].bounds.size.height
@implementation ZSCollectionViewlayout

-(instancetype)initWithString:(NSString*)aString
{
    ZSCollectionViewlayout *layout = [[ZSCollectionViewlayout alloc]init];
    layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    
    if ([aString isEqualToString:@"ZSNewsChannelView"]) {
        
        // 设置 item
        layout.itemSize = CGSizeMake(80, 30);
        
        layout.minimumInteritemSpacing = 12;
        layout.minimumLineSpacing = 10;
        layout.sectionInset = UIEdgeInsetsMake(0, 8, 0, 8);
    }else{
        
        layout.itemSize = CGSizeMake(kWIDTH, kHEIGHT - 55);
        layout.minimumLineSpacing = 0;
        layout.minimumInteritemSpacing = 0;
        
    }
    return layout;
}
@end
